<template>
  <div class="son">
    <h3>我是Son组件（孙组件）,{{ car }}</h3>
  </div>
</template>

<script>

import {inject} from "vue";

export default {
  name: 'SonCom',
  components: {},
  setup() {
    // 数据
    // 方法
    let car = inject('car');
    // 返回对象
    return{
      car
    }
  }
}
</script>

<style>
.son {
  background-color: orange;
  padding: 10px;
}
</style>
